package org.wuliu.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.wuliu.dao.GongsiDao;
import org.wuliu.pojo.Gongsi;
import org.wuliu.utils.ResponseResult;

import java.util.List;

@Controller
@RequestMapping("/gongsi")
@CrossOrigin(value = "*")
public class GongsiController {
    @Autowired
    private GongsiDao gongsiDao;
    @RequestMapping("/show")
    @ResponseBody
    public ResponseResult getAll(){
        List<Gongsi> list=gongsiDao.getAll();
        return new ResponseResult(list);
    }
}
